<!-- The template to display files that have been uploaded to S3 already -->
<!-- This essentially is a stand-in for the template_download partial for the s3_cors_fileupload gem's purposes -->
<script id="template-uploaded" type="text/x-tmpl">
  <tr class="template-uploaded" id="source_file_{%=o.id%}">
    <td style="width: 80px;">
      <span class="preview">
        {% if (o.image == true) { %}
          <a href="{%=o.full_url%}" title="{%=o.name%}" download="{%=o.name%}" data-gallery>
            <img src="{%=o.full_url%}"></image>
          </a>
        {% } %}
      </span>
    </td>
    <td>
      <span style="font-size: 12px;"><a href="{%=o.full_url%}" title="{%=o.name%}" download="{%=o.name%}" {%=o.image ? 'data-gallery' : ''%}>{%=o.name%}</a> - {%=formatFileSize(o.size)%} - {%=o.sourceWidth%}<br /><textarea value ="" disabled >![{%=o.name%}]({%=o.full_url%})</textarea></span>
    </td>
    <td>
      <button type="button" class="btn btn-info btn-sm select-gallery-image" data-dismiss='modal' data-url="{%=o.full_url%}">
        Select
      </button>
      {% if (o.delete_url) { %}
        <button type="button" class="btn btn-danger btn-sm delete" data-type="DELETE" data-url="{%=o.delete_url%}" data-object_id="{%=o.id%}" data-confirmation="Are you sure?" {% if (o.delete_with_credentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
          <i class="glyphicon glyphicon-trash"></i>
          <span>Delete</span>
        </button>
      {% } else { %}
        <button type="button" class="btn btn-warning cancel">
          <i class="glyphicon glyphicon-ban-circle"></i>
          <span>Cancel</span>
        </button>
      {% } %}
    </td>
  </tr>
</script>
